#ifndef _SEGMENT_H_
#define _SEGMENT_H_

#include "point.h"
#include "line.h"

typedef std::pair<point_t, point_t> segment_t;


struct less_by_angle
{
    less_by_angle(segment_t const & seg);
    bool operator() (segment_t const & l, segment_t const & r) const;
private:
    segment_t seg_;
};

struct segment_hash
{
    int operator()(segment_t const & segment) const;
};

point_pos point_position(segment_t const & segment, point_t const & point);

bool intersects(segment_t const & l, segment_t const & r, point_t & res);
bool intersects(segment_t const & l, segment_t const & r);

#endif
